Errors in the code
==================
errors are listed in the order in which they occur after the function LPIMain() is run

file CalcLPI.R:
L98: -1 should mean an unknown value, but the logarithm of the population value of 0.1 is also -1 (Error 2 in SI)

L106: noted that time series with two data points are excluded, but the subsequent command (L110) does not correspond to this
L130: missing PopN = PopN + OffsetVal can generate an error
L163: a population series of zeros in non-consecutive years will generate an error

L202: GAM method is not implemented if the mean value of the population series is equal to the first value of the population series (Error 1 in SI)

L331: -1 should mean an unknown value, but the logarithm of the population value of 0.1 is also -1 (Error 2 in SI)
L386: -1 should mean an unknown value, but the logarithm of the population value of 0.1 is also -1
	(this error occurs when the population series of zeros is shorter than 6 records and OFFSET_DIFF is set to TRUE) (Error 2 in SI)
L388: -1 should mean an unknown value, but the logarithm of the population value of 0.1 is also -1 (Error 2 in SI)
L395-396: falsely unknown lambdas of value -1 are excluded (Error 2 in SI)
L398: -1 should mean an unknown value, but the difference between two logs can also be -1 (Error 2 in SI)
L420: falsely unknown lambdas of value -1 are excluded (Error 2 in SI)

L426: lambdas of value 1 are omitted (Error 3 in SI)
L440: lambda is calculated only from values in the range -1 (LAMBDA_MIN) to 1 (LAMBDA_MAX) (-1 and 1 excluded), even though CAP_LAMBDAS is set to FALSE (Error 3 in SI)
L447: lambda is not calculated if values are less than -1 (LAMBDA_MIN), even though lambda values are not supposed to be limited (CAP_LAMBDAS=FALSE) (Error 3 in SI)
L455: lambda is not calculated if values are greater than 1 (LAMBDA_MAX), even though lambda values are not supposed to be limited (CAP_LAMBDAS=FALSE) (Error 3 in SI)

file ProcessFile.R:
L133: a value of -1 never occurs, lambdas are in the range (-1,1), an unknown value is set to NA (Error 3 in SI)
	or lambdas are in the range (LAMBDA_MIN, LAMBDA_MAX), even though lambda values are not supposed to be limited, and falsely unknown lambdas of value -1 are excluded

file calculate_index.R:
L98: missing DI=1 (Error 4 in SI)
L103: this setting (misplaced DI=1) causes the Index in the J-th year to be equal to the Index of the previous year (no change in the growth rate), even though it should be -99 (unknown) (Error 4 in SI)
L125: DT will never be NA, DT can only be 0 (all groups without values in a given year) or a certain value (Error 4 in SI)

file bootstrap_lpi.R:
L42: a value of null never occurs
L47: selecting from one number of value higher than 1 gives an incorrect value - if there is only one number, only that one number should be sampled (Error 5 in SI)

L51: lambdas of value -1 are not included in the calculation, even though they do not represent unknown values (if LAMBDA_MIN is less than -1) (Error 6 in SI)

L80: lambdas should be unknown values but function as a false zero (no change in the growth rate) (Error 7 in SI)
L94: missing DI=1 (Error 7 in SI)
L96: this setting (misplaced DI=1) causes BootI in the J-th year to be equal to BootI of the previous year (no change in the growth rate), even though it should be NA (Error 7 in SI)

file LPIMain.R: 
(L491-537 will not run unless the argument SWITCH_PT_FLAG is called)
L491: selecting from one number of value higher than 1 gives an incorrect value - if there is only one number, only that one number should be sampled
L498: falsely unknown lambdas of value -1 are excluded
L537: falsely unknown lambdas of value -1 are excluded

L553: if CI_FLAG is set to FALSE/0, an error message is generated

S10-S13 Table from McRae et al. 2017:
the sum of the weights of individual realms is less than one; 0.9811515 for a terrestrial ecosystem and 0.986994 for a freshwater ecosystem (Error 8 in SI; not fixed)





